//
//  HotelAlbumVideoCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/8/7.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "HotelAlbumVideoCell.h"

@implementation HotelAlbumVideoCell

- (void)awakeFromNib {
    [super awakeFromNib];


    self.playImageView.userInteractionEnabled = YES;
    [self.playImageView addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        
        if (_delegate && [_delegate respondsToSelector:@selector(cl_CellPlayVideoWithCell:)]){
            [_delegate cl_CellPlayVideoWithCell:self];
        }
        
    }];

}

- (void)fillCellWithModel:(CommonMediaModel *)model {
    
    self.model = model;
//    __block UIImage *placeholderImage = [UIImage imageNamed:@"placeholder"];
//    WEAKSELF
//    [[SDImageCache sharedImageCache] diskImageExistsWithKey:self.model.url completion:^(BOOL isInCache) {
//        __typeof(&*weakSelf) strongSelf = weakSelf;
//        if (isInCache) {
//            //本地存在图片,替换占位图片
//            placeholderImage = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:model.videoCover];
//        }
//        [strongSelf.coverImageView sd_setImageWithURL:[NSURL URLWithString:model.videoCover] placeholderImage:placeholderImage];
//    }];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        
        [self pp_clipCorners:UIRectCornerAllCorners radius:8];
    });
}


@end
